package com.car.sale.controller;

import com.car.sale.service.NationService;
import com.car.sale.vo.Count;
import com.car.sale.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/nation")
@ResponseBody
public class NationController {
    @Autowired
    private NationService nationService;
    @GetMapping("/hot")
    public Result<Object> getNationHot()
    {
        List<Count> countList = nationService.getCarCount();
        return Result.success(countList);
    }
}
